#ifndef TOTPWINDOW_H
#define TOTPWINDOW_H
#include <totp/totp.h>
#include <utils/popup.h>
#include <utils/clipboardwatcher.h>

#include "totplistwidget.h"
namespace data_display {
class TOTPWindow : public QDialog {
	Q_OBJECT

public:
	TOTPWindow(utils::ClipboardWatcher &clipboard_watcher, QWidget *parent = nullptr);

	TOTPWindow(const std::vector<totp::TOTP>& totps, utils::ClipboardWatcher &clipboard_watcher, QWidget *parent = nullptr);

	signals:
		void addedTotp(const totp::TOTP&);

	void deleteTotp(const totp::TOTP&);

	private slots:
		void addTOTP();

	void addTOTPToList(const QString& label, const Botan::SymmetricKey& key,
		const QString& algorithm, int digits, int period);

	void openPopupWindow();

	void fillTotpListWindow(const std::vector<totp::TOTP>& totps);

	void onTotpDeleted(const totp::TOTP& totp);
private:
	TOTPListWidget *totpListWindow;
	utils::PopUp *popup;
	utils::ClipboardWatcher &_clipboard_wather;
};
}
#endif //TOTPWINDOW_H
